package com.icoding.trangphuc

class Article{

	static mapping ={
		category cascade :'all-delete-orphan'
		news cascade : 'all-delete-orphan'
		product cascade : 'all-delete-orphan'
	}

	String subject
	String description
	String content
	Date dateCreated
	Date dateUpdated
	String realUrl
	String seoUrl
	String metaDescription
	String metaKeyword

	static constraints = {
		content blank: true, maxLength : 2000
		subject blank: false , maxLength : 1000 
		description blank:true , maxLength : 1000 
	}
	
	static hasOne = [category:Category,news:News,product:Product]
}
